var a = new tileObj('features',0,0,false);
var w = new tileObj('features',32*4,0,true);
var d = new tileObj('features',32*1,32*7,false)
var l = new tileObj('features',32*3,32*3,false)
var s = new tileObj('features',32*3,32*9,true)



tileMap =
[	[w,w,w,w,w,w,w,w,s,w],
	[w,a,a,a,a,a,a,l,l,w],
	[w,a,w,w,w,w,w,w,w,w],
	[w,a,a,a,w,a,a,a,a,w],
	[w,w,w,a,w,a,w,w,a,w],
	[w,a,a,a,a,a,a,w,a,w],
	[w,w,a,w,w,a,a,w,a,w],
	[w,a,a,a,w,w,a,w,w,w],
	[w,a,a,a,w,d,a,a,l,w],
	[w,w,w,w,w,w,w,w,w,w]]
	
var eventMap = new Array(10);
for(e=0;e<eventMap.length;e++){
	eventMap[e]=new Array(10);
}

eventMap[8][2] = new eventObj('treasure',2,8,"You found the treasure!");
eventMap[8][5] = new eventObj('exit',5,8,"You have found the exit!");
eventMap[8][5].type='goto'
eventMap[8][5].toMap = 'http://www.andrewwooldridge.com/canvas/canvasquest/lvl_003.js';

function levelSetup(){
  theGame.currMap = 'lvl_002.js';
  //theGame.theChar = new charObj('uniques',0,0,32*8,32);
  //theGame.theChar.type = 'player';
  //theGame.theChar.health = 200;
  theGame.theChar.x = 32*8
  theGame.theChar.y = 32
  //alert("updateChar")
  
  for(i=0; i<5; i++){
  		theGame.monstArr[i] = new charObj('uniques',32 * (Math.floor(Math.random() * 10)),32 * (Math.floor(Math.random() * 10)),32*8,32*8 )  		
  		theGame.monstArr[i].health = 10;
  }
  theGame.itemArr = new Array();
  theGame.itemArr[0] = new charObj('misc',32,0,32*2,32*8);
  theGame.itemArr[0].type = 'treasure';
  theGame.itemArr[0].gold = 1000;
  theGame.itemArr[0].health = 1;
}

resCount(); // tell mother ship weve been loaded
	
